import { createBrowserRouter } from 'react-router-dom'
import App from '../App'
import Detail from '../pages/Detail'
import np from 'nprogress'
import 'nprogress/nprogress.css'
const router = createBrowserRouter([
    {
        path: '/',
        element: <App></App>
    },
    {
        path: '/detail',
        element: <Detail></Detail>
    }
])
router.subscribe((state) => {
    if (state.navigation.state === 'loading') {
        np.start()
    } else if (state.navigation.state === 'idel') {
        np.down()
    }
})
export default router